package com.stox.client.ui.javafx.chartingy.persistence.chart.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.stox.client.ui.javafx.chartingy.model.chart.Chart;
import com.stox.client.ui.javafx.chartingy.model.shape.Shape;

public abstract class ChartDTO<T extends PlotDTO> implements Serializable {
	private static final long serialVersionUID = 1L;

	private List<ShapeDTO> shapes = new ArrayList<>();
	private T primaryPlot;
	private List<T> plots = new ArrayList<>();

	public ChartDTO() {
		
	}
	
	public ChartDTO(Chart<?,?> chart) {
		for(Shape shape : chart.getShapes()){
			shapes.add(new ShapeDTO(shape));
		}
	}
	
	public List<ShapeDTO> getShapes() {
		return shapes;
	}

	public void setShapes(List<ShapeDTO> shapes) {
		this.shapes = shapes;
	}
	
	public PlotDTO getPrimaryPlot() {
		return primaryPlot;
	}

	public List<T> getPlots() {
		return plots;
	}

	public void setPlots(List<T> plots) {
		this.plots = plots;
	}

	public void setPrimaryPlot(T primaryPlot) {
		this.primaryPlot = primaryPlot;
	}
	
	
}
